package com.zhz.system.repository.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhz.common.tool.mybatisplus.base.dal.entity.BasePO;
import com.zhz.common.tool.mybatisplus.base.dal.repository.impl.BaseRepositoryImpl;
import com.zhz.model.system.PermissionPoint;
import com.zhz.model.system.contract.dto.PermissionPointDTO;
import com.zhz.model.system.contract.param.PermissionPointQueryParam;
import com.zhz.system.repository.dao.PermissionPointDao;
import com.zhz.system.repository.service.PermissionPointService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

/**
 * 权限点服务实现
 *
 * @author zhouhengzhe
 * @date 2023/3/30
 */
@Service
public class PermissionPointServiceImpl extends BaseRepositoryImpl<PermissionPointDao, PermissionPointDTO, PermissionPoint, PermissionPointQueryParam> implements PermissionPointService {
    @Override
    protected QueryWrapper<PermissionPoint> getWrapper(PermissionPointQueryParam queryParam) {
        return new QueryWrapper<PermissionPoint>()
                .eq(StringUtils.isNotBlank(queryParam.getId()), BasePO.ID, queryParam.getId())
                .eq(StringUtils.isNotBlank(queryParam.getPid()), PermissionPoint.PID, queryParam.getPid())
                ;
    }
}
